import Vue from 'vue';
import Vuex from 'vuex';
import App from './app.vue';
import VueResource from 'vue-resource';
import router from './router';


import VueAwesomeSwiper from 'vue-awesome-swiper';
Vue.use(VueAwesomeSwiper);
Vue.use(VueResource);
Vue.use(Vuex);


let store = new Vuex.Store({
	state:{
		loginState:false,
		zhuceState:false,
		dengluState:false,
		bigState:false,
		xqState:false,
		detail: '',
		userinfo:'',
		yhmState:false,
		historyState:false,
		bianjiState:false
	},
	mutations:{
		changeStates(state){
			state.bigState = !state.bigState;
		},
		changeState(state){
			state.loginState=!state.loginState
		},
		changeZhuce(state){
			state.zhuceState=!state.zhuceState
		},
		changeDenglu(state){
			state.dengluState=!state.dengluState
		},
		changeXq(state,detail){
			state.detail = detail;
			state.xqState=!state.xqState;
		},
		changeUser(state,name){
			state.userinfo = name;
		},
		changeyhm(state){
			state.yhmState = !state.yhmState;
		},
		changeHistory(state){
			state.historyState=!state.historyState
		},
		changeBianji(state){
			state.bianjiState=!state.bianjiState
		}
	}
});




new Vue({
	el:'#app',
	render:a=>a(App),
	router,
	swiper:VueAwesomeSwiper,
	store,
	mounted(){
		if(localStorage.userInfo){
			this.$store.commit('changeUser',localStorage.userInfo)
		}
	}
})


